<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>每日日志报告流程</title>
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<link rel="stylesheet" type="text/css" href="$request.getContextPath()/resources/layui/css/layui.css">
<link rel="stylesheet" type="text/css" href="$request.getContextPath()/resources/bootstrap-datepicker/css/bootstrap-datepicker3.min.css">
</head>
<body>
<form class="layui-form" action="">
  <input type="hidden" name="processDefinitionKey" value="$!processDefinitionKey">
  <div class="layui-form-item">
    <label class="layui-form-label">审核人</label>
    <div class="layui-input-inline">
      <input type="text" name="reader" required  lay-verify="required" placeholder="请输入审核人名称" autocomplete="off" class="layui-input">
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">管理人</label>
    <div class="layui-input-inline">
      <input type="text" name="manager" required lay-verify="required" placeholder="请输入管理人名称" autocomplete="off" class="layui-input">
    </div>
  </div>
  <input type="hidden" name="avator" value="">
  <div class="layui-form-item layui-form-text">
    <label class="layui-form-label">内容</label>
    <div class="layui-input-block">
      <textarea name="content" id="content" placeholder="请输入日志报告内容" class="layui-textarea"></textarea>
    </div>
  </div>
  <div class="layui-form-item">
    <div class="layui-input-block submit-btn">
      <button class="layui-btn" lay-submit lay-filter="dailyLog">开启服务</button>
    </div>
  </div>
</form>
</body>
<script src="$request.getContextPath()/resources/jquery/jquery-3.1.0.min.js"></script>
<script type="text/javascript" src="$request.getContextPath()/resources/layui/layui.js"></script>
<script type="text/javascript" src="$request.getContextPath()/resources/layui/lay/modules/element.js"></script>
<script type="text/javascript">
$(function(){
	layui.use(['form', 'layedit', 'laydate'], function(){
		var form = layui.form(),layer = layui.layer,layedit = layui.layedit,laydate = layui.laydate;
		//角色描述编辑器
		var contentIndex=layedit.build('content');
		//监听提交
		form.on('submit(dailyLog)', function(data){
			var content=layedit.getText(contentIndex);
			data.field.content=content;
			$.post("$request.getContextPath()/process/instance/startDailyLog",data.field,function(data){
				//保存成功 关闭当前页
				top.layer.msg(data.msg,{
					icon: 1,
					skin: 'demo-class',
					title :'信息',
					time:500,
				    area: ['300px', '160px'],
				    offset: 'rb',
				    end :function(){
				    	if(data.code==200){
				    		var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
							parent.layer.close(index); //再执行关闭   
						}
				    }
				});
			});
		    return false;
		});
	});
});
</script>
</html>